/**
 * 
 */
package org.intelligentsia.artifacts.repository.metadata;

/**
 * @author geronimo
 * 
 */
public class SnapshotVersion {
	/**
	 * The classifier of the snapshot artifact this version
	 * information belongs to.
	 */
	private String	classifier	= "";

	/**
	 * The file extension of the snapshot artifact this version
	 * information belongs to.
	 */
	private String	extension;

	/**
	 * The resolved snapshot version of the artifact.
	 */
	private String	version;

	/**
	 * The timestamp when this version information was last
	 * updated. The timestamp is expressed using UTC in the format
	 * yyyyMMddHHmmss.
	 */
	private String	updated;

	public String getClassifier() {
		return this.classifier;
	}

	public void setClassifier(String classifier) {
		this.classifier = classifier;
	}

	public String getExtension() {
		return this.extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}

	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getUpdated() {
		return this.updated;
	}

	public void setUpdated(String updated) {
		this.updated = updated;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.classifier == null) ? 0 : this.classifier.hashCode());
		result = prime * result + ((this.extension == null) ? 0 : this.extension.hashCode());
		result = prime * result + ((this.updated == null) ? 0 : this.updated.hashCode());
		result = prime * result + ((this.version == null) ? 0 : this.version.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SnapshotVersion other = (SnapshotVersion) obj;
		if (this.classifier == null) {
			if (other.classifier != null)
				return false;
		} else if (!this.classifier.equals(other.classifier))
			return false;
		if (this.extension == null) {
			if (other.extension != null)
				return false;
		} else if (!this.extension.equals(other.extension))
			return false;
		if (this.updated == null) {
			if (other.updated != null)
				return false;
		} else if (!this.updated.equals(other.updated))
			return false;
		if (this.version == null) {
			if (other.version != null)
				return false;
		} else if (!this.version.equals(other.version))
			return false;
		return true;
	}

}
